<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>PIR Sensor<br/>
<small>
[<a class="el" href="group___hi_technic.html">HiTechnic</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="hitechnic-pir_8h.html">hitechnic-pir.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>HiTechnic PIR Sensor Driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#ga488757f55d4b8add0238b0955b60ff92">HTPIR_I2C_ADDR</a>&#160;&#160;&#160;0x02</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#gac3be637784a3b2d7da5c187887dfc117">HTPIR_DEADBAND</a>&#160;&#160;&#160;0x41</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#gad17d4cda11ee3df72d253c70b734f837">HTPIR_READING</a>&#160;&#160;&#160;0x42</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#ga1930c45f0cdcd32a7fdd44870ee83095">HTPIR_DEFAULT_DEADBAND</a>&#160;&#160;&#160;12</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#gae51eab1fa15422f6bb63a1dd16ededba">HTPIRsetDeadband</a> (tSensors link, int deadband)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#gab32cac4c52c2e3fa08a5566e28f65b8a">HTPIRreadSensor</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#ga4fe72abab6fe5449a8100d5b930c9c36">HTPIRreadSensor</a> (<a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a> muxsensor)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__htsmux.html#gae535601c6d1a8544ed23e79d545ce45c">tConfigParams</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#ga4229fde70c12ad18f10ec32382d0909c">HTPIR_config</a> = {HTSMUX_CHAN_I2C, 1, 0x02, 0x42}</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#gac7fb2effc22e62d8f95b28833d3b31f5">HTPIR_I2CRequest</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_t_p_i_r.html#ga806197eed108810e14a0a329a5ab8158">HTPIR_I2CReply</a></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>HiTechnic PIR Sensor </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gac3be637784a3b2d7da5c187887dfc117"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_DEADBAND" ref="gac3be637784a3b2d7da5c187887dfc117" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HTPIR_DEADBAND&#160;&#160;&#160;0x41</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>HTPIR Mode control </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00038">38</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga1930c45f0cdcd32a7fdd44870ee83095"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_DEFAULT_DEADBAND" ref="ga1930c45f0cdcd32a7fdd44870ee83095" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HTPIR_DEFAULT_DEADBAND&#160;&#160;&#160;12</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-pir-test1_8c-example.html#a0">hitechnic-pir-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00041">41</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga488757f55d4b8add0238b0955b60ff92"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_I2C_ADDR" ref="ga488757f55d4b8add0238b0955b60ff92" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HTPIR_I2C_ADDR&#160;&#160;&#160;0x02</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>HTPIR I2C device address </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00037">37</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="gad17d4cda11ee3df72d253c70b734f837"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_READING" ref="gad17d4cda11ee3df72d253c70b734f837" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HTPIR_READING&#160;&#160;&#160;0x42</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>HTPIR Heading Upper bits </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00039">39</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gab32cac4c52c2e3fa08a5566e28f65b8a"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIRreadSensor" ref="gab32cac4c52c2e3fa08a5566e28f65b8a" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTPIRreadSensor </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the current levels detected by the sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTPIR port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>level detected by sensor, will be between -128 and 127. </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-pir-test1_8c-example.html#a3">hitechnic-pir-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00088">88</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga4fe72abab6fe5449a8100d5b930c9c36"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIRreadSensor" ref="ga4fe72abab6fe5449a8100d5b930c9c36" args="(tMUXSensor muxsensor)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int HTPIRreadSensor </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__htsmux.html#gab5bad1759ac110c43e66c3ec54047f42">tMUXSensor</a>&#160;</td>
          <td class="paramname"> <em>muxsensor</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the current levels detected by the sensor </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">muxsensor</td><td>the SMUX sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>level detected by sensor, will be between -128 and 127. </dd></dl>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00107">107</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="gae51eab1fa15422f6bb63a1dd16ededba"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIRsetDeadband" ref="gae51eab1fa15422f6bb63a1dd16ededba" args="(tSensors link, int deadband)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool HTPIRsetDeadband </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>deadband</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>The sensor element with the PIR sensor generates continuous noise. The size of the deadband is set to minimize the number of false detections which will be reported by the sensor. If the deadband value is too small, some of the noise fluctuations will exceed the deadband threshold and will appear as actual non-zero readings. <br/>
 The Deadband field may be set from 0 to 47 to define the half width of the deadband. The default value is 12. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the HTPIR port number </td></tr>
    <tr><td class="paramname">deadband</td><td>the amount </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if no error occured, false if it did </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="hitechnic-pir-test1_8c-example.html#a2">hitechnic-pir-test1.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00068">68</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga4229fde70c12ad18f10ec32382d0909c"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_config" ref="ga4229fde70c12ad18f10ec32382d0909c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__htsmux.html#gae535601c6d1a8544ed23e79d545ce45c">tConfigParams</a> <a class="el" href="group___h_t_p_i_r.html#ga4229fde70c12ad18f10ec32382d0909c">HTPIR_config</a> = {HTSMUX_CHAN_I2C, 1, 0x02, 0x42}</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold SMUX config data for sensor </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00049">49</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga806197eed108810e14a0a329a5ab8158"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_I2CReply" ref="ga806197eed108810e14a0a329a5ab8158" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group___h_t_p_i_r.html#ga806197eed108810e14a0a329a5ab8158">HTPIR_I2CReply</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C reply data </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00053">53</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
<a class="anchor" id="gac7fb2effc22e62d8f95b28833d3b31f5"></a><!-- doxytag: member="hitechnic&#45;pir.h::HTPIR_I2CRequest" ref="gac7fb2effc22e62d8f95b28833d3b31f5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__common.html#gaa172ef131853460e5b9f5c6db81d30f4">tByteArray</a> <a class="el" href="group___h_t_p_i_r.html#gac7fb2effc22e62d8f95b28833d3b31f5">HTPIR_I2CRequest</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Array to hold I2C command data </p>

<p>Definition at line <a class="el" href="hitechnic-pir_8h_source.html#l00052">52</a> of file <a class="el" href="hitechnic-pir_8h_source.html">hitechnic-pir.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
